package com.small.nacos.core.datasource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.transaction.support.TransactionTemplate;

import java.io.IOException;

/**
 * 数据源接口
 */
public interface DataSourceService {
    /**
     * Initialize the relevant resource information.
     *
     * @throws Exception exception.
     */
    void init() throws Exception;

    /**
     * Reload.
     *
     * @throws IOException exception.
     */
    void reload() throws IOException;

    /**
     * 获取jdbc模板
     * @return
     */
    JdbcTemplate getJdbcTemplate();

    /**
     * 获取事务模板
     *
     * @return TransactionTemplate.
     */
    TransactionTemplate getTransactionTemplate();

}
